package org.javaren.proxy;

import javax.crypto.Cipher;
import java.util.Arrays;

/**
 * @author cxx
 * @create 2020-07-14 11:55
 **/
public class Test {

    public static void main(String[] args) {

       byte[] bs =  new byte[]{0x0E,77,77, 77, 0x2E ,64 ,61 ,69 ,0x6C ,69 ,69 ,70 ,0x2E ,63 ,63};
//
//        System.out.println (new String (bs));
//
//      byte[] p = new byte[]{0x00,0x50};
//
//        System.out.println (bytes2Int(p));

//        for (byte b : int2Bytes (80)) {
//            System.out.println (b);
//        }


//        byte[] bs2= new byte[]{0x0C,0x67,0x2E,0x63,0x73,0x64,0x6E,0x69,0x6D,0x67,0x2E,0x63,0x6E};

//        byte[] bs2= new byte[]{0x0D ,0x77 ,0x77 ,0x77 ,0x2E ,0x62 ,0x61 ,0x69 ,0x64 ,0x75 ,0x2E ,0x63,0x6F,0x6D};

        byte[] al = new byte[]{0x05 ,0x01 ,0x00 ,0x03 ,0x0D ,0x77 ,0x77 ,0x77 ,0x2E ,0x62 ,0x61 ,0x69 ,0x64 ,0x75 ,0x2E ,0x63 ,0x6F ,0x6D ,0x01 , (byte) 0xBB};
        String domainName = new String(Arrays.copyOfRange (al,4,al.length - 2));

        System.out.println (domainName);

//        System.out.println (new String(bs2));
//        System.out.println (new String(bs2,Charset.forName ("gb2312")));
//        System.out.println (new String(bs2,Charset.forName ("utf-8")));
//        System.out.println (new String(bs2,Charset.forName ("iso-8859-1")));
//        for (byte aByte : "blog.csdn.net".getBytes ()) {
//            System.out.print (aByte + " ");
//        }
        //        System.out.println (new String(bs2,Charset.forName ()));

//        System.out.println (new String (bs, Charset.forName ("UTF-8")));
//        System.out.println (new String (bs, Charset.forName ("ISO8859-1")));
//        System.out.println (new String (bs, Charset.forName ("GBK")));

    }

}
